//
//  ProductOperationSectionHeaderView.m
//  FactorySale
//
//  Created by 胡小康 on 2020/4/21.
//  Copyright © 2020 主事丫环. All rights reserved.
//

#import "ProductOperationSectionHeaderView.h"
#import <Masonry.h>
@interface ProductOperationSectionHeaderView()
@property (nonatomic,strong)UIView *greenView;
@property (nonatomic,strong)UIView *line;
@end
@implementation ProductOperationSectionHeaderView

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = [UIColor whiteColor];
        [self.greenView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.offset(10);
            make.left.offset(20);
            make.width.offset(5);
            make.bottom.offset(-10);
        }];
        [self.line mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.offset(0);
            make.bottom.offset(-1);
            make.height.offset(1);
        }];
        [self.sectionTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.greenView.mas_top).offset(0);
            make.left.equalTo(self.greenView.mas_right).offset(20);
            make.right.offset(20);
            make.bottom.offset(-10);
        }];
        [self.arrowImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.offset(22);
            make.right.offset(-20);
            make.bottom.offset(-20);
            make.width.offset(15);
        }];
    }
    return self;
}
- (UIView *)greenView{
    if (!_greenView) {
        _greenView = [[UIView alloc] init];
        _greenView.backgroundColor = [UIColor colorWithHexString:@"#31CEA9"];
        _greenView.layer.cornerRadius = 2;
        _greenView.layer.masksToBounds = YES;
        [self addSubview:_greenView];
    }
    return _greenView;
}
- (UIView *)line{
    if (!_line) {
        _line = [[UIView alloc] init];
        _line.backgroundColor = [UIColor colorWithHexString:@"#E5E5E5"];
        [self addSubview:_line];
    }
    return _line;
}
- (UILabel *)sectionTitleLabel{
    if (!_sectionTitleLabel) {
        _sectionTitleLabel = [[UILabel alloc] init];
        _sectionTitleLabel.textAlignment = NSTextAlignmentLeft;
        _sectionTitleLabel.font = [UIFont systemFontOfSize:14.0];
        _sectionTitleLabel.textColor = [UIColor colorWithHexString:@"#333333"];
        _sectionTitleLabel.text = @"标题";
        [self addSubview:_sectionTitleLabel];
    }
    return _sectionTitleLabel;
}
- (UIImageView *)arrowImageView {
    if (!_arrowImageView) {
        _arrowImageView = [[UIImageView alloc] init];
        _arrowImageView.image = [UIImage imageNamed:@"向上"];
        [self addSubview:_arrowImageView];
    }
    return _arrowImageView;
}
@end
